<template>
   <div>
       <!-- 查询字符串列表
       <ul>
            <li v-for="(hero,index) in heros" :key="index">
                {{hero.name}}
                生成的地址就会是 /detail?id=index...
                <router-link :to="{name:'detail',query:{id:index}}">查看</router-link>
            </li>
      </ul> -->

        path 列表
      <ul>
            <li v-for="(hero,index) in heros" :key="index">
                {{hero.name}}
                <router-link :to="{name:'detail',params:{id:index}}">查看</router-link>
            </li>
      </ul>

   </div>
</template>

<script>
   export default {
       data () {
       return {
           heros: [{
               name: '李白'
           },{
               name: '王昭君'
           }]
       }
   },
   methods: {

   }
 }
</script>

<style>
 
</style>
